<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
<title>图片轮换</title>
	<link rel="stylesheet" href="css/scroll.css">

</head>

<body>
<div class="scroll">
	<div id="num">
		<a href="#" onmousedown="dian(this)">1</a>
		<a href="#" onmousedown="dian(this)">2</a>
		<a href="#" onmousedown="dian(this)">3</a>
		<a href="#" onmousedown="dian(this)">4</a>
		<a href="#" onmousedown="dian(this)">5</a>
	</div>
	<img src="images/1.gif" alt="图片" id="photo"/>
</div>
</body>
<script type="text/javascript">
	function dian(e){
	var a=e.innerHTML;
	var num=parseInt(a);
	switch(num){
		case 1:
		document.getElementById("photo").src="images/1.gif";
		break;
		case 2:
		document.getElementById("photo").src="images/2.gif";
		break;
		case 3:
		document.getElementById("photo").src="images/3.jpg";
		break;
		case 4:
		document.getElementById("photo").src="images/4.jpg";
		break;
		case 5:
		document.getElementById("photo").src="images/5.gif";
		break;
		default:
		alert("错误！");
		break;
		
	}
	}
</script>
</html>
